#!/usr/bin/python
# -*- coding: utf-8 -*-

# project - description
# Copyright (C) 2010  Cédric Bonhomme - http://cedricbonhomme.org/
#
# For more information : http://bitbucket.org/cedricbonhomme/
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>

__author__ = "Cedric Bonhomme"
__version__ = "$Revision: 0.1 $"
__date__ = "$Date: 2011/02/25 $"
__copyright__ = "Copyright (c) Cedric Bonhomme"
__license__ = "GPLv3"

import cgi
import utils
utils.create_base()

print "Content-Type: text/plain\n\n"
form = cgi.FieldStorage()
latitude = form.getvalue("latitude", "(none)")
longitude = form.getvalue("longitude", "(none)")
utime = form.getvalue("utime", "(none)")

utils.add_location(longitude, latitude, utime)

print "Location added."